<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<p:dialog id="dialogCadastro" modal="true" width="40%" position="top"
	appendTo="@(body)" widgetVar="dialogCadastroLocal"
	header="Cadastro de Local" resizable="true" draggable="true">
	<p:ajax event="close" listener="#{localMB.close}"
		update="frmDialogLocal" />
	<h:form id="frmDialogLocal">

		<h:panelGrid columns="2">

			<p:outputLabel value="Codigo:"></p:outputLabel>
			<p:inputText value="#{localMB.localSelecionado.codigo}"
				disabled="true"></p:inputText>

			<p:outputLabel value="Descrição:" for="iptdescricao"></p:outputLabel>
			<p:inputText id="iptdescricao"
				value="#{localMB.localSelecionado.descricao}" size="50"
				disabled="#{localMB.consultando}" required="true"
				requiredMessage="Descrição é obrigatória!" maxlength="100"></p:inputText>

			<p:outputLabel value="Quantidade:" for="iptqtd"></p:outputLabel>
			<p:inputText value="#{localMB.localSelecionado.quantidade}"
				disabled="#{localMB.consultando}" id="iptqtd" required="true"
				onkeypress="return(mascaras(this,numero))" />


		</h:panelGrid>
		<h:panelGrid columns="2" style="border:0px">
			<p:commandButton value="Confirma" actionListener="#{localMB.salvar}"
				rendered="#{not localMB.consultando}"
				update="frmDialogLocal,:frmTab:tabela,:mensagem"
				oncomplete="validaDialog(args,'dialogCadastroLocal','frmDialogLocal:dialogCadastro')" />


			<p:commandButton id="btnFechar" value="Cancela"
				onclick="dialogCadastroLocal.hide()" immediate="true" />

		</h:panelGrid>

	</h:form>
</p:dialog>

</html>